|
|
|
|
|
|
|
You can send a WM_SETREDRAW message to most list boxes and combo boxes with the SendMessage() API call. You pass a True or False value to tell the control to turn on or off its redraw functionality. You can then load the control and tell it to turn on its redraw capability. |
|
|
|
|
|
|
|
|
Using Move Is Faster Than Setting Left and Top Properties |
|
|
|
|
|
|
|
|
If you need to move a form or a control to a new location, make sure you always use the Move method instead of setting the Top and Left properties separately. Every time you set the Top property, it will move the form/control and then redraw the entire form/control. When you then set the Left property, it will also move the form/control and redraw the entire form/control. This cause two paint operations, and in a graphical environment, this can take awhile. Therefore, avoid code like the following: |
|
|
|
 |
|
|
|
|
For intLoop = 1 To 1500
lblMove.Top = intLoop
lblMove.Left = intLoop
Next |
|
|
|
|
|
|
|
|
Instead, use the Move method, like this: |
|
|
|
 |
|
|
|
|
For intLoop = 1 To 1500
lblMove.Move intLoop, intLoop
Next |
|
|
|
|
|
|
|
|
If youre updating the values of several records inside a loop, you should place BeginTrans and CommitTrans around the loop. This can significantly speed up the update process. Therefore, you should avoid using code like this: |
|
|
|
 |
|
|
|
|
For lngLoop = 0 To 10
oRS.MoveFirst
Do Until oRS.EOF
oRS!szLast_nm = "GATES"
oRS.Update
oRS.MoveNext
Loop
Next |
|
|
|
|
|